
cd "D:\Dropbox\book_welfare\replication"


**********************************
* Bookstat genre 
**********************************


use data\bookstat_gender_pyear_genre_asin.dta, clear
 

		collapse (sum) males=N_male name_present=N_name total, by(pyear genre)

		gen N =total 
		gen Nf = (name_present - males)
		gen Nm = males
		gen Nu = N -Nf - Nm 

		su * 


		egen gno = group(genre)
		label var Nf "female-authored books"
		label var Nu "Unknown gender-authored books"
		label var Nm "male-authored books"

		eststo clear

		eststo: reg  Nm Nf Nu
		eststo: reghdfe Nm Nf Nu, absorb(gno )
		eststo: reghdfe Nm Nf Nu, absorb(pyear )
		eststo: reghdfe Nm Nf Nu, absorb(gno pyear)


local pattern prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})

	esttab,  noomitted mtitles("OLS"  "genre FE"  "vintage FE"  "all FE") drop( _cons) se replace  label nonotes star(* 0.10 ** 0.05 *** 0.01) scalars("r2_a $\overline{R^2}$") nocons

	esttab using "latex_text\tables\entry_displacement_asin.tex",  noomitted mtitles("OLS"  "genre FE"  "vintage FE"  "all FE")  drop( _cons) se replace  label nonotes star(* 0.10 ** 0.05 *** 0.01) scalars("r2_a $\overline{R^2}$") nocons booktabs 
